#include<stdio.h>
int inverse(int n)
{
    int a = 0;
    
    while(n)
    {
        a = a * 10 + n % 10;
        n /= 10;
    }
    return a;

}
int main()
{
    int n, sum;
    scanf("%d", &n);
    sum = n + inverse(n);
    printf("%d", sum);
    
    return 0;
}